package com.wenwu.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wenwu.common.bean.User;
import com.wenwu.common.bean.UserExample;
import com.wenwu.common.page.PaginationVO;

public interface UserMapper extends Dao {
	int countByExample(UserExample example);

	int deleteByExample(UserExample example);

	int deleteByPrimaryKey(Integer userId);

	int insert(User record);

	int insertSelective(User record);

	List<User> selectByExample(UserExample example);

	User selectByPrimaryKey(Integer userId);

	int updateByExampleSelective(@Param("record") User record,
			@Param("example") UserExample example);

	int updateByExample(@Param("record") User record,
			@Param("example") UserExample example);

	int updateByPrimaryKeySelective(User record);

	int updateByPrimaryKey(User record);

	// 查询符合条件用户个数
	int selectTotalRecord(@Param("user") User user,
			@Param("pageVo") PaginationVO pageVo) throws SQLException;

	// 查询用户信息
	List<User> selectUserList(@Param("user") User user,
			@Param("pageVo") PaginationVO pageVo) throws SQLException;

	int selectUserByJobNo(String jobno) throws SQLException;

	int deleteUserByKey(List<?> list) throws SQLException;

	// 重置密码
	int resetPassword(@Param("newpassword") String newpassword,
			@Param("userId") Integer userId) throws SQLException;

	// 锁定、解锁用户
	int updateUserLock(@Param("locked") String locked,
			@Param("userId") Integer userId) throws SQLException;
}